package ar.com.fiuba.ElectronicCircuitAnalyst.infraestructure.db40.repository.aspect;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;

import ar.com.fiuba.ElectronicCircuitAnalyst.application.api.CircuitService;
import ar.com.fiuba.ElectronicCircuitAnalyst.application.api.ComponentService;
import ar.com.fiuba.ElectronicCircuitAnalyst.application.impl.CircuitServiceImpl;
import ar.com.fiuba.ElectronicCircuitAnalyst.application.impl.ComponentServiceImpl;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.exceptions.AlreadyExistingCircuitElementException;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.exceptions.CircuitElementNotFoundException;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.exceptions.InvalidCircuitElementException;

@ContextConfiguration(locations = {"classpath:ApplicationContextTest.xml"})
public class TransactionalAspectTesting extends AbstractJUnit38SpringContextTests{
	 
	@Autowired
	private CircuitService circuitService;
	
	@Autowired
	private ComponentService componentService;
	
	@Test
	public void testAspectingCiruitService() throws CircuitElementNotFoundException, InvalidCircuitElementException, AlreadyExistingCircuitElementException{
		assertFalse(circuitService instanceof CircuitServiceImpl);
	}
	
	@Test
	public void testAspectingComponentService() throws CircuitElementNotFoundException, InvalidCircuitElementException, AlreadyExistingCircuitElementException{
		assertFalse(componentService instanceof ComponentServiceImpl);
	}

	/**
	 * @return the circuitService
	 */
	public CircuitService getCircuitService() {
		return circuitService;
	}

	/**
	 * @param circuitService the circuitService to set
	 */
	public void setCircuitService(CircuitService circuitService) {
		this.circuitService = circuitService;
	}

	/**
	 * @return the componentService
	 */
	public ComponentService getComponentService() {
		return componentService;
	}

	/**
	 * @param componentService the componentService to set
	 */
	public void setComponentService(ComponentService componentService) {
		this.componentService = componentService;
	}

}
